<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import {useRouter} from "vue-router/dist/vue-router";
import {onMounted} from "vue";

export default {
  name: 'App',
  setup(){
    const router = useRouter()
    onMounted(()=>{
      // eslint-disable-next-line no-undef
      let role = $cookies.get('role')
      if (role === null){
        router.push("/")
      }
      if (role === '2') {
        router.push({path: '/student'})
      }
    })
  }
}
</script>

<style>
ul {
  list-style: none;
}
a {
  text-decoration: none;
}
#app {
  font-family: "Microsoft YaHei", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
  background-color: #eee;
}
</style>
